//养护公司
var vm = new Vue({
	el: '#app',
	data: function() {
		return {}
	},
	mounted: function() {
		mui.init({});
		mui.ready(function() {
            $.ajax({
                url:"insertLog",
                data:{"type":"company"},
                type:"post",
                dataType:"json",
                success : function(){}
            });
			$("img.lazy").lazyload({
				effect: "fadeIn"
			});
			mui.previewImage();
			var myChart = echarts.init(document.getElementById('chart-base'));
			var myChart2 = echarts.init(document.getElementById('yh_zdw'));
            var myChart3 = echarts.init(document.getElementById('chart-people'));
			// 指定图表的配置项和数据
			var option1 = {
				legend: {
					orient: 'horizontal',
					left: 'center',
					data: ['职能管理人员', '自有养护人员', '派遣人员']
				},
				series: [{
					name: '作业类型统计',
					type: 'pie',
					radius: '45%',
					center: ['50%', '60%'],
					color: ['#58B7FF', '#ed3f14', '#8492A6', '#19be6b', '#ff9900'],
					data: [{
							value: 157,
							name: '职能管理人员'
						},
						{
							value: 4671,
							name: '自有养护人员'
						},
						{
							value: 2737,
							name: '派遣人员'
						}
					],
					labelLine: {
						normal: {
							length: 0
						}
					},
					itemStyle: {
						normal: {
							label: {
								show: true,
								formatter: '{c}人'//{b} :{d}%
							},
							labelLine: {
								show: true
							}
						},
						emphasis: {
							shadowBlur: 10,
							shadowOffsetX: 0,
							shadowColor: 'rgba(0, 0, 0, 0.5)'
						}
					}

				}]
			};
			var option2 = {
				color: ['#3398DB', '#FF4949', '#13CE66'],
				legend: {
					data: ['子公司', '项目部', '分公司']
				},
				xAxis: [{
					type: 'category',
					data: ['市政养护', '浦江桥隧', '城建养护'],
					axisTick: {
						alignWithLabel: true
					}
				}],
				yAxis: [{
					type: 'value'
				}],
				series: [{
					name: '子公司',
					type: 'bar',
					label: {
						normal: {
							show: true,
							position: 'inside'
						}
					},
					barWidth: '20%',
					data: [14, 5, 2]
				}, {
					name: '项目部',
					type: 'bar',
					label: {
						normal: {
							show: true,
							position: 'inside'
						}
					},
					barWidth: '20%',
					data: [1, 16, 10]
				}, {
					name: '分公司',
					type: 'bar',
					label: {
						normal: {
							show: true,
							position: 'inside'
						}
					},
					barWidth: '20%',
					data: [2, 3, 1]
				}]
			};
            var option3 = {
                legend: {
                    orient: 'horizontal',
                    left: 'center',
                    data: ['市政养护', '浦江桥隧', '城建养护']
                },
                series: [{
                    name: '作业类型统计',
                    type: 'pie',
                    radius: '45%',
                    center: ['50%', '60%'],
                    color: ['#58B7FF', '#ed3f14', '#8492A6', '#19be6b', '#ff9900'],
                    data: [{
                        value: 4775,
                        name: '市政养护'
                    },
                        {
                            value: 2495,
                            name: '浦江桥隧'
                        },
                        {
                            value: 295,
                            name: '城建养护'
                        }
                    ],
                    labelLine: {
                        normal: {
                            length: 0
                        }
                    },
                    itemStyle: {
                        normal: {
                            label: {
                                show: true,
                                formatter: '{c}人'//{b} :{d}%
                            },
                            labelLine: {
                                show: true
                            }
                        },
                        emphasis: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }

                }]
            };
			myChart.setOption(option1);
			myChart2.setOption(option2);
            myChart3.setOption(option3);
		})
	}
})